package com.rd.sys.common.fileexport.inter;

import java.util.List;

import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;

import baseproj.common.exception.BaseServiceException;

import com.rd.sys.dto.commmon.base.BaseDto;

public abstract class ExportOperator {

    /**
     * 导出操作处理类
     * 
     * @param dto
     *            基础dto，携带分页信息
     * @param splitSign
     *            分隔符
     * @return
     * @throws BaseServiceException
     * @throws Exception
     */
    public abstract List<String> operation(BaseDto dto, String splitSign) throws BaseServiceException, Exception;

    /**
     * 获取service
     * 
     * @param beanName
     * @return
     */
    public Object getService(String beanName) {
        WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext();
        return context.getBean(beanName);
    }
}
